<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"  xmlns:p="http://primefaces.org/ui">

<f:view>
<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
<h:head>
    <title>#{text['upload.title']}</title>
    <meta name="menu" content="AdminMenu"/>
    <meta name="heading" content="#{text['upload.heading']}"/>
    <c:set var="jqueryProvided" value="true" scope="request"/>
</h:head>

<div class="span3">
    <h2><h:outputText value="#{text['upload.heading']}"/></h2>
    <p><h:outputText value="#{text['upload.message']}"/></p>
</div>
<div class="span7">
    <h:form id="uploadForm" enctype="multipart/form-data" styleClass="well form-horizontal">

        <div class="control-group">
            <h:outputLabel styleClass="control-label" for="name" value="#{text['uploadForm.name']}"/>
            <div class="controls">
                <h:inputText value="#{fileUpload.name}" id="name" required="true"/>
                <p:message for="name" />
            </div>
        </div>

        <div class="control-group">
            <h:outputLabel styleClass="control-label" for="file" value="#{text['uploadForm.file']}"/>
            <div class="controls">
                <p:fileUpload id="file" value="#{fileUpload.file}" mode="simple" required="true"
                        fileUploadListener="#{fileUpload.upload}"/>
                <p:message for="file" />
            </div>
        </div>

        <div class="form-actions">
            <h:commandButton value="#{text['button.upload']}" action="#{fileUpload.upload}"
                id="upload" styleClass="btn btn-primary" ajax="false"/>
            <h:commandButton value="#{text['button.cancel']}" action="mainMenu" immediate="true"
                id="cancel" styleClass="btn" onclick="bCancel=true"/>
        </div>
    </h:form>
</div>
</f:view>
</html>
